<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%request.setCharacterEncoding("UTF-8"); %>
    <%@page import="java.sql.SQLException"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑文章</title>
</head>
<body>
<h1>编辑文章</h1>
<%
String title = request.getParameter("title") ;
title=new String (title.getBytes("iso8859-1"),"utf-8"); 

String article = request.getParameter("article") ;
System.out.println(article);
article=new String (article.getBytes("iso8859-1"),"utf-8"); 
%>
<form action="SkipToArticleList" method="post">
	<p>标题：<input type="text" name="title" value="<%=title%>"<br/></p>
	内容：<input type="text" name="article" value="<%=article%>"/><br/>
	<input type="submit" value="发布"/>
</form>

<%			
/* UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值 */
		String sql = "   update article set title='', article='' where title=  '"+ title +"'   ";
		Connection conn = null;
		Statement stmt = null;
		/* ResultSet rs = null; */
		
			// 加载驱动
			Class.forName("com.mysql.jdbc.Driver");
			// 获得链接
			conn = DriverManager.getConnection("jdbc:mysql://localhost/demo?useSSL=true&"
					+ "user=root&password=root" + "&useUnicode=true&characterEncoding=UTF8");
			// 获得语句对象
			stmt = conn.createStatement();
			// 执行SQL语句

			int i = stmt.executeUpdate(sql);
			
	%>
		<a href="<%=request.getContextPath()%>/SkipToArticleList">返回</a>
	
		
		<%-- <% response.sendRedirect("/blog/SkipToArticleList");%> --%>
		

</body>
</html>